package com.zrf.testchatgpt.service.impl;

import com.zrf.testchatgpt.entity.Permission;
import com.zrf.testchatgpt.mapper.PermissionMapper;
import com.zrf.testchatgpt.service.IPermissionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PermissionServiceImpl implements IPermissionService {
    @Resource
    PermissionMapper permissionMapper;

    @Override
    public List<Permission> queryByRoleId(Integer userid) {
        return permissionMapper.queryByRoleId(userid);
    }

    @Override
    public int updatePermissionById(String userId, List<Integer> permissionId) {
        return permissionMapper.updatePermissionById(userId,permissionId);
    }

    @Override
    public int deletePermissionById(String userId, List<Integer> permissionId) {
        return permissionMapper.deletePermissionById(userId,permissionId);
    }
    @Override
    public List<Integer> getPermissionByRoleId(String roleId){
        return permissionMapper.getPermissionByRoleId(roleId);
    }

    @Override
    public List<Integer> getPermissionByUserId(String userId) {
        return permissionMapper.getPermissionByUserId(userId);
    }
}
